package v1

import (
	"devops-super/api"
	"devops-super/internal/model/entity"
	"devops-super/internal/model/mymodel"
	"github.com/gogf/gf/v2/frame/g"
)

type GetPageLstReq struct {
	g.Meta `method:"get" path:"/oplog/page-list" summary:"分页获取操作日志列表" tags:"操作日志"`
	*api.PageLstReq
	OperUrl   string   `json:"operUrl" description:"operUrl"`
	TimeRange []string `json:"timeRange"` // 时间范围[开始,结束]
	DeptId    int64    `json:"deptId" description:"deptId"`
}

// GetPageLstRes 获取操作日志列表响应
type GetPageLstRes struct {
	*api.PageLstRes[*mymodel.OperLogResponse] // 使用自定义响应结构体
}

type GetOneReq struct {
	g.Meta `method:"get" path:"/oplog/getOne" summary:"获取一条操作日志" tags:"操作日志"`
	OperId uint64 `v:"min:1#日志ID必须" path:"operId"`
}

type GetOneRes struct {
	Info *entity.SysOperLog `json:"info"`
}

type AddReq struct {
	g.Meta `method:"post" path:"/oplog" summary:"新增操作日志" tags:"操作日志"`
	*mymodel.OperLog
}

type AddRes struct{}

type DelReq struct {
	g.Meta `method:"delete" path:"/oplog/{operId}" summary:"删除操作日志" tags:"操作日志"`
	OperId uint64 `v:"min:1#日志ID必须" path:"operId"`
}

type DelRes struct{}

type BatchDelReq struct {
	g.Meta  `method:"delete" path:"/oplog/batch-del" summary:"批量删除操作日志" tags:"操作日志"`
	OperIds []uint64 `v:"required|min-length:1#操作日志ID列表不能为空|操作日志ID列表长度不能小于1" json:"operIds"`
}

type BatchDelRes struct{}
